import './assets/main.css'
import 'amfe-flexible'
import '@/assets/icons/iconfont.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import Drag from "@/utils/drag"
import axios from 'axios'
import "@/router/permission"
const app = createApp(App)
app.use(ElementPlus, {
    locale: zhCn,
})
app.use(Drag)
app.use(router)
app.use(store)
import './mock'
axios.get('/config/serverConfig.json').then(res => {
    app.config.globalProperties.$BASE_URL = res.data.BASE_URL
    app.config.globalProperties.num = 5
    app.provide('BASE_URL', res.data.BASE_URL)
    app.provide('WEBPATH', res.data.WEBPATH)
    // store.commit('home/SETBASE_URL', res.data.BASE_URL)
    sessionStorage.setItem('BASE_URL', res.data.BASE_URL)
    sessionStorage.setItem('MAPURL', res.data.MAPURL)
    sessionStorage.setItem('WEBPATH', res.data.WEBPATH)
    window.vm = app
})

app.mount('#app')
